package com.itic.appbase.framework.type;

public enum OrderState {

    Paying("0","待支付"),Sending("1","待发货"),Confirm("2","待收货"),Judging("3","已完成"),ApplyRefund("4","申请退款");
    private String state;
    private String name;

    OrderState(String state, String name) {
        this.state = state;
        this.name = name;
    }

    public String getState() {
        return state;
    }

    public String getName() {
        return name;
    }

    public void setState(String state) {
        this.state = state;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static OrderState getOrderState(String state){
        OrderState orderState = null;
        switch (state){
            case "0":
                orderState = OrderState.Paying;
                break;
            case "1":
                orderState = OrderState.Sending;
                break;
            case "2":
                orderState = OrderState.Confirm;
                break;
            case "3":
                orderState = OrderState.Judging;
                break;
            case "4":
                orderState = OrderState.ApplyRefund;
                break;
        }
        return orderState;
    }
}
